<template>
    <div class="home">
        <leftnavs @sent-listnum="getlistnum"></leftnavs>
        
        <div class="right" :style="{ transform: `translateX(${moveX}px)`}">
            <div class="righttop">
                <el-breadcrumb separator-class="el-icon-arrow-right">
                    <el-breadcrumb-item :to="{ path: '/' }">当前位置</el-breadcrumb-item>
                    <el-breadcrumb-item>首页</el-breadcrumb-item>
                    
                </el-breadcrumb>
                <div class="top-rightbox">
                    <div>
                        <img src="../assets/topone.svg" alt="">
                        <span>提醒</span>
                    </div>
                    <div>
                        <img src="../assets/toptwo.svg" alt="">
                        <span>帮助</span>
                    </div>
                </div>
            </div>
            <div class="rightlist">
                <div class="rightlisttop">
                    <span>日汇总</span>
                    <span>月汇总</span>
                </div>
                <div class="blueline">
                </div>
                <div class="tradingbox">
                    <span>账户类型</span>
                    <el-select v-model="value" placeholder="店铺余额">
                        <el-option
                        v-for="item in options"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                        </el-option>
                    </el-select>
                    <span>添加时间</span>
                    <div class="block">
                        
                        <el-date-picker
                        v-model="value"
                        type="monthrange"
                        range-separator="-"
                        start-placeholder="开始月"
                        end-placeholder="至今">
                        </el-date-picker>
                    </div>
                    <div class="searchbutton">
                        <img  src="/img/search.f4f7c865.svg" alt="">
                        <span >查询</span>
                    </div>
                </div>
                <el-table
                        ref="multipleTable" 
                        :data="tableData"
                        tooltip-effect="dark"
                        style="width: 100%"
                        @selection-change="handleSelectionChange">
                        
                        <el-table-column
                        label="日期"
                        width="120">
                        <template slot-scope="scope">{{ scope.row.date }}</template>
                        </el-table-column>
                        <el-table-column
                        prop="name"
                        label="姓名"
                        width="120">
                        </el-table-column>
                        <el-table-column
                        prop="address"
                        label="地址"
                        show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column label="操作">
                            <template slot-scope="scope">
                                <el-button
                                size="mini"
                                @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
            </div>
            
        </div>
        
    </div>
    </template>
    
    <script>
    import HelloWorld from '@/components/HelloWorld.vue'
    import Leftnavs from '@/components/Leftnavs.vue';
    import Small from '@/components/Small.vue'
    
    import * as echarts from 'echarts'
 
    export default {
      name: 'HomeView',
      
      components: {
        HelloWorld,
        Small,
        Leftnavs,
          
      },
      data(){
        return{
            chart:null,
            listnum:0,
            value: '',
            tableData: [{
          date: '2016-05-03',
          name: '王小',
          address: '上海市普陀区金沙江路 1518 弄',
          shopname: '香蕉',
          shopclassify: '水果',
          status: '正常',
          visitnum: 100,
          salenum: 1000,
          wtgroup: '',
        },  {
            date: '2016-05-03',
          name: '小虎',
          address: '北京市海淀区西二旗',
          shopname: '香蕉',
          shopclassify: '水果',
          status: '正常',
          visitnum: 100,
          salenum: 1000,
          wtgroup: '',
        }, {
        date: '2016-05-03',
          name: '王小虎',
          address: '上海市浦东新区',
          shopname: '香蕉',
          shopclassify: '水果',
          status: '正常',
          visitnum: 100,
          salenum: 1000,
          wtgroup: '',
        }, {
            date: '2016-05-03',
          name: '王虎',
          address: '上海市浦东新区',
          shopname: '香蕉',
          shopclassify: '水果',
          status: '正常',
          visitnum: 100,
          salenum: 1000,
          wtgroup: '',
        }, {
            date: '2016-05-03',
          name: '王小',
          address: '北京市海淀区西二旗金沙江路 1518 弄',
          shopname: '香蕉',
          shopclassify: '水果',
          status: '正常',
          visitnum: 100,
          salenum: 1000,
          wtgroup: '',
        }, {
            date: '2016-05-03',
          name: '小虎',
          address: '北京市海淀区西二旗路 1518 弄',
          shopname: '香蕉',
          shopclassify: '水果',
          status: '正常',
          visitnum: 100,
          salenum: 1000,
          wtgroup: '',
        }, {
            date: '2016-05-03',
          name: '王虎',
          address: '上海市浦东新区 1518 弄',
          shopname: '香蕉',
          shopclassify: '水果',
          status: '正常',
          visitnum: 100,
          salenum: 1000,
          wtgroup: '',
        }],
        multipleSelection: [],
            options: [{
                value: '选项1',
                label: '蔬菜'
                }, {
                value: '选项2',
                label: '水果'
                },],
                value: '',
                dates: [{
                value: '选项1',
                label: '正常'
                }, {
                value: '选项2',
                label: '淘汰'
                },],
        }
      },
     
      methods:{
        getlistnum(i){
            this.listnum=i
            console.log(this.listnum);
            
        },
        dellistnum(){
            this.listnum=0
        },
        gonext(data){
            if(this.$route.name!=data){
				this.$router.push({name:data})
			}else{
				console.log('出错了');
			}
        },
		rehome(){
			if(this.$route.name!='home'){
				this.$router.push({name:'home'})
				
			}else{
				console.log('已经在主页了');
				
			}
  		},
        handleSelectionChange() {
            this.multipleSelection = this.$refs.multipleTable.selection;
        },
        
      },
      computed: {
        moveX() {
          return this.listnum >= 1 ? 115 : 0;
        },
      },
      
    
    }
    </script>
    <style scoped>
    *{
        padding: 0;
        margin: 0;
    }
    li{
        cursor: pointer;
    }
    .left{
        height: auto;
        width: 98px;
        background-color: rgb(0, 21, 41);	
    }
    ul{
        list-style: none;
        
    }
    .myphoto img{
        width: 48px;
        height: 48px;
        border-radius: 50%;
    }
    .myphoto{
        padding: 18px;
    }
    li img{
        height: 18px;
        margin-left: 13px;
        width: auto;
    }
    .right{
        transition:  all .8s;
    }
    .othersvg{
        width: 18px !important;
        height: auto;
    }
    li{
        display: flex;
        align-items: center;
        height: 44px;
    }
    
    li span{
        display: block;
        float: right;
        margin-left: 20px;
        font-size: 13px;
        color: rgb(228, 228, 228);
        font-weight: 400;
    }
    .morewith{
        padding-right: 2.5px;
        padding-left: 2.5px;
    }
    .righttop{
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 1260px;
        height: 36px;
        background-color: rgb(255, 255, 255);
        border: none;
        border-radius: 0px;
        box-shadow: rgba(0, 0, 0, 0.35) 0px 0px 5px;
    }
    .home{
        display: flex;
        margin: 0 auto;
        width: 1360px;
        margin: 0 auto;
    }
    .el-breadcrumb{
        margin-left: 10px;
    }
    .top-rightbox{
        
        color: #555;
        display: flex;
        align-items: center;
    }
    .top-rightbox div{
        font-size: 14px;
        margin-right: 15px;
        color: #555;
        display: flex;
        align-items: center;
    }
    .top-rightbox div img{
        margin-right: 5px;
    }
    .botonebox{
        display: flex;
    }



    .shopreturn img{
        margin-left: 20px;
    }
    


    .addshop span{
        line-height: 30px;
    }
    .rightlist{
        margin-left: 10px;
        margin-top: 13px;
        background-color: #fff;
        padding: 20px 10px 0 18px;
    }

    .searchone{
        display: flex;
        align-items: center;
    }
   
    .midclassify div{
        width: 100px;
        height: 30px;
        cursor: pointer;
    }
   
    .midlinebox{
        width: 1222px;
        height: 2px;
        background-color: #0079fe;
        margin-bottom: 35px;
    }
    ::v-deep .el-table__header-wrapper{
        border-color: rgba(204, 204, 204, 1);
        border-width: 1px;
        border-style: solid;
        border-left: 0px;
        border-right: 0px;
       
    }
    ::v-deep .el-table th {
        
        background-color: #f2f2f2;
    }
    ::v-deep .cell{
        line-height: 1;
    }
    ::v-deep .el-table th.el-table__cell>.cell{
        padding-left: 14px;
    }
    ::v-deep .el-date-editor{
        width: 200px;
    }
    ::v-deep .el-button{
        border: 0;
        margin-left: 5px;
        margin-right: 5px;
        color: #0099ff;
    }



    ::v-deep .el-table{
        border-left: 1px solid #dddddd;
    }
    .tradingbox{
        width: 1220px;
        height: 63px;
        background: inherit;
        background-color: rgba(244, 249, 250, 1);
        box-sizing: border-box;
        border-width: 1px;
        border-style: solid;
        padding-left: 20px;
        border-color: rgba(228, 228, 228, 1);
        border-radius: 0px;
        display: flex;
        font-size: 14px;
        align-items: center;
        margin-bottom: 15px;
    }
    .searchbutton{
        
        width: 80px;
        height: 30px;
        background: inherit;
        background-color: rgba(0, 153, 255, 1);
        border: none;
        border-radius: 2px;
        font-weight: 400;
        font-style: normal;
        font-size: 13px;
        display: flex;
        justify-content: center;
        align-items: center;
        color: #fff;
        margin-left: 15px;
    }
    ::v-deep .el-input__inner  {
        height: 30px;
        line-height: 30px; /* 确保文本垂直居中 */
        margin-left: 15px;
    }
    
/* 同理，调整下拉箭头的大小和位置 */
    ::v-deep .el-select .el-input__icon {
    line-height: 30px; /* 确保下拉箭头垂直居中 */
    }
    ::v-deep .el-icon-date {
    line-height: 22px; /* 确保下拉箭头垂直居中 */
    }
    ::v-deep .el-range-separator{
        line-height: 22px;
    }
    .rightlisttop{
        display: flex;
        font-size: 14px;

    } 
    .rightlisttop span{
        margin-left: 30px;
    }  
    .blueline{
        margin-top: 10px;
        margin-bottom: 15px;
        width: 1220px;
        height: 1px;
        background-color: #0079fe;
    }
    ::v-deep .el-select{
        width: 179px;
        margin-right: 30px;
    }
    </style>